package com.itheima.service;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
import java.util.function.Consumer;
@Service
public class MsgConsumerService {
    @Bean
    public Consumer<String> handleMessage() {
        return (data) -> {
            // 处理接收到的数据
            System.out.println("MsgConsumerService Received data: " + data);
        };
    }
}